package com.software.cm.spring.service;

import com.software.cm.spring.dao.EmployeeDAO;
import com.software.cm.spring.model.Employee;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by mcan on 29/11/2014.
 */

@Service("employeeService")
@Transactional(readOnly = true)
public class EmployeeService
{
    @Autowired
    EmployeeDAO employeeDAO;

    public EmployeeDAO getEmployeeDAO() {
        return employeeDAO;
    }

    public void setEmployeeDAO(EmployeeDAO employeeDAO) {
        this.employeeDAO = employeeDAO;
    }

    @Transactional(readOnly = false)
    public void addEmployee(Employee employee)
    {
        getEmployeeDAO().register(employee);
    }
}
